<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>信息管理系统界面</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs">
            <a href="main.jsp">
                <img src="../images/loginlogo.png" style="height: 65px;width: 255px;margin-left: -15px">
            </a>
        </div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:;">
                    <img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">
                    ${loginUser.ename}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="/logout">注销</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test" lay-header-event="menuUrl" >
                <%--<li class="layui-nav-item">
                    <a class="" href="javascript:;">营销管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:void(0);" onclick="showMain('market/customer/customerList.jsp')">客户管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('market/customerBrowse/customerBrowse.jsp')">客户浏览</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('market/order/orderList.jsp')">订购单管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('market/orderExamine/orderExamineList.jsp')">订购单审核</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">仓库管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:void(0);" onclick="showMain('user.html')">仓库管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('role.html')">仓库浏览</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('role.html')">出库管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('role.html')">入库管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('role.html')">库存管理</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">采购管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:void(0);" onclick="showMain('purchase/purchaseExamine/purchaseExamineList.jsp')">采购单管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('purchase/purchase/purchaseList.jsp')">采购单审核</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('purchase/brand/brandList.jsp')">品牌管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('purchase/productType/productTypeList.jsp')">商品类型管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('purchase/product/productList.jsp')">商品管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('purchase/manufacturer/manufacturerList.jsp')">厂商管理</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">数据统计</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:void(0);" onclick="showMain('user.html')">客户销量统计</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('purchase/statistics/statisticsList.jsp')">厂商采购统计</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('role.html')">出库统计</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('role.html')">入库统计</a></dd>
                    </dl>
                </li>--%>
                <c:forEach items="${modules}" var="pmodule">
                    <c:if test="${pmodule.pModule.id==null}">
                        <li class="layui-nav-item">
                            <a class="" href="javascript:;">${pmodule.mName}</a>
                            <dl class="layui-nav-child">
                                <c:forEach items="${modules}" var="module">
                                    <c:if test="${module.pModule.id==pmodule.id}">
                                        <dd><a href="javascript:void(0);" onclick="showMain('${module.url}')">${module.mName}</a></dd>
                                    </c:if>
                                </c:forEach>
                            </dl>
                        </li>
                    </c:if>
                </c:forEach>

                <%--<li class="layui-nav-item">
                    <a class="" href="javascript:;">${module.pModule.mName}</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:void(0);" onclick="showMain('sys/users/userList.jsp')">用户管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('sys/dept/deptList.jsp')">部门管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('sys/position/positionList.jsp')">职位管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('sys/modules/moduleList.jsp')">模块管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('sys/logs/logList.jsp')">日志管理</a></dd>
                        <dd><a href="javascript:void(0);" onclick="showMain('sys/area/areaList.jsp')">区域管理</a></dd>
                    </dl>
                </li>--%>
            </ul>
        </div>
    </div>

    <div class="layui-body" id="main">
        <!-- 内容主体区域 -->
        <div style="height: 45px;background-color: rgb(0,150,136);line-height: 45px">
            <p style="margin-left: 15px">
                <span style="color: rgb(57,61,73)">位置：</span>
                <a href="main.jsp">首页</a>
            </p>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        仅供学习交流，请勿用于任何商业用途
    </div>
</div>
<script src="${pageContext.request.contextPath}/layui/jquery2.1.1.js"></script>
<script src="${pageContext.request.contextPath}/layui/layui.js"></script>
<script>
    //JS
    layui.use(['element','layer', 'util'], function(){
        var  element=layui.element
            ,layer = layui.layer
            ,util = layui.util;
        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function(othis){
                layer.msg('展开左侧菜单的操作', {icon: 0});
            }
        });
    });

    function showMain(url){
        $("#main").load(url);
    }
</script>
</body>
</html>